package com.lin.blog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lin.blog.constant.LikedStatusConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;

/**
 * @program: blog
 * @description: 用户点赞表
 * @author: Lin
 * @create: 2020-05-14 16:05
 **/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="UserLike对象", description="")
public class UserLike {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    //被点赞的用户的id
    private Long likedUserId;

    //点赞的文章id
    private Long likedArticleId;

    //点赞的状态.默认未点赞
    private Integer status = LikedStatusConstant.UNLIKE;

    public UserLike() {
    }

    public UserLike(Long likedUserId, Long likedArticleId, Integer status) {
        this.likedUserId = likedUserId;
        this.likedArticleId = likedArticleId;
        this.status = status;
    }
}
